
const Koa = require('koa');
const Router = require('koa-router');

const app = new Koa();

const router = new Router();

//接收get值 
router
    .get('/',(ctx,next)=>{
        ctx.body = ctx.query;
    })
    // .get('/todo',(ctx,next)=>{
    //     ctx.body = 'todo page!';
    // })

//装载路由
app.use(router.routes()).use(router.allowedMethods())

app.listen(3000,() =>{
     
    console.log('[class6] server is starting at port 3000!');
    
})